<?php
    include_once ("MySql.php");
    include_once ("../entity/T_SCOB_MULTA_DETAL_ESTADO.php");
    include_once ("../entity/T_SCOB_SEDE.php");
    include_once ("../entity/T_SCOB_AREAS.php");
    
    class RecursosDA extends dal{
        public function RecursosDA(){
            parent::dal();
        }
        public function listarSede(){
            $sql = "CALL SGISS_SEDE";
            $result = parent::execute($sql);
            while ($fila = mysqli_fetch_object($result)){
                $obj = new T_SCOB_SEDE();
                $obj->ID_SEDE = $fila->ID_SEDE;
                $obj->DESCRIPCION = $fila->DESCRIPCION;
                $sede[]=$obj;
            }
            return $sede;
        }
        public function listarEstado(){
            $sql = "CALL SGISS_MULTA_DETAL_ESTADO";
            $result = parent::execute($sql);
            
            while ($fila = mysqli_fetch_object($result)){
                $obj = new T_SCOB_MULTA_DETAL_ESTADO();
                $obj->CODIGO = $fila->CODIGO;
                $obj->DESCRIPCION = $fila->DESCRIPCION;
                $estado[] = $obj;
            }
            return $estado;
        }
        public function listarArea(){
            $sql = "CALL SGISS_AREAS";
            $result = parent::execute($sql);
            
            while($fila = mysqli_fetch_object($result)){
                $obj = new T_SCOB_AREAS();
                $obj->CODIGO = $fila->CODIGO;
                $obj->DESCRIPCION = $fila->CODIGO." - ". $fila->DESCRIPCION;
                $obj->RESPONSABLE = $fila->RESPONSABLE;
                $area[] = $obj;
            }
            return $area;
        }
    }
?>
